var fs = require('fs');
var jpeg = require('jpeg-js');
var bmpBuffer = fs.readFileSync('20181219163115-00001.jpg');
var bmpData = jpeg.decode(bmpBuffer);
var rawImageData = jpeg.encode({ data: bmpData.data, width: bmpData.width * 0.1, height: bmpData.height * 0.1 });

fs.writeFileSync('image.jpg', rawImageData.data);
